package com.wengluobiancheng.demo03;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemo01 {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(10022);
        System.out.println("111");
        Socket accept = ss.accept();
        System.out.println("222");
        InputStream inputStream = accept.getInputStream();
        int b;
        while ((b = inputStream.read()) != -1) {
            System.out.println((char) b);
        }
        ss.close();
        inputStream.close();
    }
}
